package StudyCode.summary.Basic.stringbuilder;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class StringBuilderAppend {
	public static void main(String[] args) {
		Object objectRef = "hello";
		String string = "world";
		char[] charArray = {'a', 'b', 'c', 'd', 'e', 'f'};
		boolean booleanValue = true;
		char characterValue = 'Z';
		int integerValue = 7;
		long longValue = 10000000000L;
		float floatValue = 2.5f;
		double doubleValue = 33.333;

		StringBuilder lastBuffer = new StringBuilder("by java");
		StringBuilder stringBuilder = new StringBuilder("ha ha");

		System.out.println("stringBuilder 追加前内容是:" + stringBuilder.toString());
		stringBuilder.append(objectRef).append("%n").append(string).append("%n").append(charArray).append("%n")
				.append(charArray, 0, 3).append("%n").append(booleanValue).append("%n")
				.append(characterValue).append("%n").append(integerValue).append("%n").append(longValue)
				.append("%n").append(floatValue).append("%n").append(doubleValue).append("%n").append(lastBuffer);
		System.out.printf("stringBuilder 追加后内容是:%n%s%n", stringBuilder.toString());
	}
}
